package com.dyh.quickdemo.type94;

import com.dyh.quickdemo.demos.lbdFactoryBean.FunctionEnhancer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.function.Consumer;
import java.util.function.Function;

/*
@Author=Joey Wheeler
@Date=2021/4/2 11:04
*/
@Configuration
public class PushE02ServiceConfig {

    @Autowired
    OrderInfoBiz orderInfoBiz;

    @Bean
    Function<String,Boolean>  e02Puhser(){
        return orderCode->{
            orderInfoBiz.buildWmsPushDto();
            /*xxxxx*/
            System.out.println("1111");
            return true;
        };
    }

    @Bean
    Function<String,Boolean> e02PuhserV2(){
        return FunctionEnhancer.with(orderCode->{
            orderInfoBiz.buildWmsPushDto();
            /*xxxxx*/
            System.out.println("dawdwad");
            return true;
        }).logStartEnd().hideException().build();
    }

    @Bean
    Consumer<String> e04Backer(){
        return e->{};
    }

}
